package my.mall.admin.api.config

import com.aliyun.oss.OSSClientBuilder
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
open class OssConfig(
    @Value("\${oss.access-key}")
    private val accessKey: String,
    @Value("\${oss.secret-key}")
    private val secretKey: String,
    @Value("\${oss.endpoint}")
    private val endpoint: String,
) {

    @Bean
    open fun ossClient(): com.aliyun.oss.OSS {
        return OSSClientBuilder().build(endpoint, accessKey, secretKey)
    }

}